package ch.jamme.conf;

/**
 * Defines how many parallel threads should be used for a given marshall process
 * @author Mario Fusco
 */
public interface MarshallerThreadStrategy {

	/**
	 * Returns the number of parallel thread that should be used to marshall the given object.
	 * If the returned number is lesser than 2 no parallel threads will be spawn.
	 * @param toBeMarshalled The object that is going to be marshalled
	 * @return The number or threads to use. 
	 */
	int getMarshallerThreadsNumber(Object toBeMarshalled);
	
	/**
	 * Returns the number of parallel thread that should be used to unmarshall the given xml.
	 * If the returned number is lesser than 2 no parallel threads will be spawn.
	 * @param xml The xml string that is going to be unmarshalled
	 * @return The number or threads to use.
	 */
	int getUnmarshallerThreadsNumber(String xml);
}
